/**
 * 配置类，这里存放所有配置，商户可以扩展该类<br />
 * <b>[注意]</b> 使用收付直通车API时，请务必先配置该类中的变量，如appid等
 *
 * @author xiezz
 * @version 1.1.2
 */
package com.pay.sdk.common;

import com.pay.sdk.util.IPUtil;

public class Configure {

	// SDK版本号
	private static final String version = "1.0";

	// 商户号，格式如
	private static String merchantNo = "562084306991529984";
	private static String key = "adc1dc1d91f040eb9917a85168695ed8";


	// 字符集
	private static String input_charset = "utf-8";

	// 本机IP地址，POST直联交易时使用
	private static String ip = IPUtil.getLocalIp();

	// 是否为开发测试模式，true时将连接测试环境，false时将连接生产环境
	private static boolean devEnv = true;

	// 是否验签，true验证应答报文签名，false不验证签名，建议不要修改此项为false，生产环境请务必更改为true
	private static boolean needChkSign = true;

	// HTTP POST通讯类，如果需要使用自己的类库，请修改该值
	public static String httpsRequestClassName = "com.pay.sdk.comm.HttpsPostRequest";

	// 出金请求网关
//	 public static final String LIQUIDATION_GATEWAY_PAI = "http://pay.shopping98.com/api/liquidation/gateway.shtml";
//	 public static final String LIQUIDATION_GATEWAY_DEV_PAI ="http://paytest.shopping98.com/api/liquidation/gateway.shtml";
	public static final String LIQUIDATION_GATEWAY_PAI = "http://localhost:8080/api/liquidation/gateway.shtml";
	public static final String LIQUIDATION_GATEWAY_DEV_PAI = "http://localhost:8080/api/liquidation/gateway.shtml";

	
	// // 入金请求网关
	public static final String PAY_GATEWAY_API = "http://pay.shopping98.com/pay/gateway.shtml";
	public static final String PAY_GATEWAY_DEV_API = "http://paytest.shopping98.com/pay/gateway.shtml";
//	public static final String PAY_GATEWAY_API = "http://localhost:8080/pay/gateway.shtml";
//	public static final String PAY_GATEWAY_DEV_API = "http://localhost:8080/pay/gateway.shtml";

	
	public static final String CASHIER_GATEWAY_API = "http://pay.shopping98.com/pay/cashier/gateway.shtml";
	public static final String CASHIER_GATEWAY_DEV_API = "http://paytest.shopping98.com/pay/cashier/gateway.shtml";
	
//	public static final String CASHIER_GATEWAY_API = "http://localhost:8080/pay/cashier/gateway.shtml";
//	public static final String CASHIER_GATEWAY_DEV_API = "http://localhost:8080/pay/cashier/gateway.shtml";
//	
//	 public static final String PAY_GATEWAY_API ="http://localhost:8081/pay/gateway.shtml";
//	 public static final String PAY_GATEWAY_DEV_API="http://localhost:8081/pay/gateway.shtml";

	// 以下四个变量为SDK出现错误时，返回的字符串，可以根据需要自己设置（注意不是服务端返回的）
	// 通讯失败时返回的报文
	public static String TXN_ERROR_RESULT = "{\"errcode\":\"EPAY_29001\",\"errmsg\":\"[EPAY_29001]通讯错误或超时，交易未决\"}";
	// 系统异常时返回的报文
	public static String SYS_ERROR_RESULT = "{\"errcode\":\"EPAY_29099\",\"errmsg\":\"[EPAY_29099]未知错误，请检查是否为最新版本SDK或是否配置错误\"}";
	// 对账文件下载，写入文件异常返回报文
	public static String FILE_ERROR_RESULT = "{\"errcode\":\"EPAY_29002\",\"errmsg\":\"[EPAY_29002]写入对账文件失败\"}";
	// 验签失败
	public static String SIGN_ERROR_RESULT = "{\"errcode\":\"EPAY_29098\",\"errmsg\":\"[EPAY_29098]应答消息验签失败，交易未决\"}";
	// 对账文件下载，下载成功返回报文
	public static String SUCCESS_RESULT = "{\"errcode\":\"EPAY_00000\",\"errmsg\":\"[EPAY_00000]下载成功\"}";

	public static String getMerchantNo() {
		return merchantNo;
	}

	public static void setMerchantNo(String merchantNo) {
		Configure.merchantNo = merchantNo;
	}

	public static String getInput_charset() {
		return input_charset;
	}

	public static void setInput_charset(String input_charset) {
		Configure.input_charset = input_charset;
	}

	public static String getIp() {
		return ip;
	}

	public static void setIp(String ip) {
		Configure.ip = ip;
	}

	public static boolean isDevEnv() {
		return devEnv;
	}

	public static void setDevEnv(boolean devEnv) {
		Configure.devEnv = devEnv;
	}

	public static boolean isNeedChkSign() {
		return needChkSign;
	}

	public static void setNeedChkSign(boolean needChkSign) {
		Configure.needChkSign = needChkSign;
	}

	public static String getVersion() {
		return version;
	}

	public static String getKey() {
		return key;
	}

	public static void setKey(String key) {
		Configure.key = key;
	}

}
